package it.unisa.beans;


import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.validation.constraints.*;


@Entity

public class Account {

	
	public Account() {
		super();
	}
	
	public String getSsn() {
		return ssn;
	}

	public void setSsn(String ssn) {
		this.ssn = ssn;
		
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public float getPositionX() {
		return positionX;
	}

	public void setPositionX(float positionX) {
		this.positionX = positionX;
	}

	public float getPositionY() {
		return positionY;
	}

	public void setPositionY(float positionY) {
		this.positionY = positionY;
	}

	public int getOnline() {
		return online;
	}

	public void setOnline(int online) {
		this.online = online;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public int getEnabled() {
		return enabled;
	}

	public void setEnabled(int enabled) {
		this.enabled = enabled;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Set<Petroglyph> getPetroglyphs() {
		return petroglyphs;
	}

	public void setPetroglyphs(Set<Petroglyph> petroglyphs) {
		this.petroglyphs = petroglyphs;
	}

	public Set<Comment> getComments() {
		return comments;
	}

	public Set<Contour> getContours() {
		return contours;
	}

	public Set<Photo> getPhotos() {
		return photos;
	}

	public Set<AccountRoute> getAccountRoutes() {
		return accountRoutes;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

	public void setContours(Set<Contour> contours) {
		this.contours = contours;
	}

	public void setPhotos(Set<Photo> photos) {
		this.photos = photos;
	}

	public void setAccountRoutes(Set<AccountRoute> accountRoutes) {
		this.accountRoutes = accountRoutes;
	}

	@Id 
	@Column(name="ssn")
	private String ssn;	
	@Column(name="name")
	private String name;
	@Column(name="surname")
	private String surname;
	@Column(name="email")
	private String email;
	@Column(name="nickname")
	private String nickname;
	@Column(name="positionX")
	private float positionX;
	@Column(name="positionY")
	private float positionY;
	@Column(name="online")
	private int online=-1;
	@Column(name="password")
	private String password;
	@OneToMany(fetch = FetchType.EAGER,mappedBy="account")
	private Set<Comment> comments=new HashSet<Comment>();
	@Column(name="enabled")
	private int enabled;
	@OneToMany(fetch = FetchType.EAGER,mappedBy="account")
	private Set<Contour> contours=new HashSet<Contour>();
	@Column(name="role")
	private String role;
	@OneToMany(fetch = FetchType.EAGER,mappedBy="account")
	private Set<Photo> photos=new HashSet<Photo>();
	@OneToMany(fetch = FetchType.EAGER,mappedBy="account")
	private Set<Petroglyph> petroglyphs=new HashSet<Petroglyph>();
	@OneToMany(fetch = FetchType.EAGER,mappedBy="id.account")
	private Set<AccountRoute> accountRoutes=new HashSet<AccountRoute>();
	
	
}
